<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
		<script type="text/javascript" src="js/json-serialization.js"></script>
		<script type="text/javascript" src="js/consts.js"></script>
		<script type="text/javascript" src="js/events.js"></script>
		<script type="text/javascript" src="js/init.js"></script>
		<script type="text/javascript" src="js/functions.js"></script>
		<script type="text/javascript" src="js/scripts.js"></script>
		<link rel="stylesheet" type="text/css" href="css/styles.css" />
		<script>
			$(document).ready(function() {
				$('#background').get(0).addShadow("black", 20, 80, 5, 5);
				update();
				setInterval(function() {
					if ( System.Gadget.Settings.readString("last_update") < ((new Date()).getTime() - 60*60*1000).toString()) {
						$.getJSON(
							"http://serials-checker.kex1k.ru/api.php?jsoncallback=?",
							{
								content : "episodes",
								ids : "all"
							},
							function(data) {
								System.Gadget.Settings.writeString("last_update",(new Date()).getTime().toString());
								Episodes.data = data;
								Episodes.save(data);
								update();
							}
						);
					}
				}, 5*1000);
			});
		</script>
	</head>
	<body id="gadget">
		<g:background id="background"></g:background>
		<div id="content"></div>
	</body>
</html>